package ZiFuStream.FileReader;

import java.io.FileReader;
import java.io.IOException;
import java.util.Arrays;

public class Demo1 {
    public static void main(String[] args) throws IOException {
        FileReader fr = new FileReader("day24\\a.txt");

        StringBuilder sb = new StringBuilder();
        int ch;
        while ((ch = fr.read()) != -1) {
            sb.append((char) ch);
        }
        fr.close();
        System.out.println(sb);

        String str = sb.toString();

        String[] arr1 = str.split("-");
        int[] arr2 = new int[arr1.length];

        for (int i = 0; i < arr1.length; i++) {
            int i1 = Integer.parseInt(arr1[i]);
            arr2[i] = i1;
        }

        Arrays.sort(arr2);
        System.out.println(Arrays.toString(arr2));
    }
}
